function myAjax(url, data, type) {
    let result = null;
    // let username = sessionStorage.getItem("username");
    // data.loginName = username;
    let temp = {loginName: sessionStorage.getItem("username")};

    $.ajax({
        url: url,
        data: Object.assign(temp, data),
        type: type,
        async: false,
        dataType: 'json',
        success: function (data) {
            console.log(data);
            result = data;
        }
    });
    return result;
}

function myFileAjax(url, data, type) {
    let result = null;
    $.ajax({
        url: url,
        data: data,
        type: type,
        async: false,
        dataType: 'json',
        //保证js的文件格式
        contentType: false,
        processData: false,
        success: function (data) {
            console.log(data);
            result = data;
        }
    });
    return result;
}

function toNullValue(value) {
    return value == undefined ? "" : value;
}


function toNullValue(value) {
    return value == undefined ? "" : value;
}

$(function () {
    isLogin();
});

function isLogin() {
    let username = sessionStorage.getItem("username");
    console.log(username)
    if (username == null) {
        window.open("/html/login.html", "_self");
    } else {

    }
}